/* 
 * Copyright (c) 2010 Adam Markiewicz
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

/**
 * @file core/types.h
 * @author Adam Markiewicz
 * 
 * This file contains definitions of basic types used by Clea. Those included
 * sifned and unsigned integer types with known size, floating point types and
 * character types for multibyte strings.
 * 
 * @section Racionale
 * 
 * 1. In many situations it is important to know exacly size of integer types.
 *    Because standard doesn't specify those differences between compilers must
 *    be handled.
 * 
 * 2. To keep consistency floating types are defined similarly to integer types.
 * 
 * 3. Various size conventions are used for wchar_t type. Therefore new char
 *    types are defined with specified sizes.
 */

#ifndef __CLEA_CORE_TYPES
#define __CLEA_CORE_TYPES

namespace Clea
{
    namespace Core
    {
        /*
         * Signed integers
         */
        
        /**
         * @brief 8-bit signed integer
         */
        typedef char int8;
        
        /**
         * @brief 16-bit signed integer
         */
        typedef short int16;
        
        /**
         * @brief 32-bit signed integer
         */
        typedef int int32;
        
        /**
         * @brief 64-bit signed integer
         */
        typedef long long int64;
        
        /*
         * Unsigned integers
         */
        
        /**
         * @brief 8-bit unsigned integer
         */
        typedef unsigned char uint8;
        
        /**
         * @brief 16-bit unsigned integer
         */
        typedef unsigned short uint16;
        
        /**
         * @brief 32-bit unsigned integer
         */
        typedef unsigned int uint32;
        
        /**
         * @brief 64-bit unsigned integer
         */
        typedef unsigned long long uint64;
        
        /*
         * Floating point types
         */
        
        /**
         * @brief 32-bit float
         */
        typedef float float32;
        
        /**
         * @brief 64-bit float
         */
        typedef double float64;
        
        /**
         * @brief 128-bit float
         */
        typedef __float128 float128;
        
        /*
         * Additional types
         */
        
        /**
         * Size type
         */
        typedef uint32 size_type;
        
        /**
         * Difference type
         */
        typedef int32 difference_type;
    }
}

#endif // __CLEA_CORE_TYPES
